package nml.mail.reg.await;


import nml.mail.reg.Reg;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.WebDriverWait;

public class  ah163_com extends Reg{

	public void reg(String username, String password) {		
		

		String url = "http://ah163.com/extend/en/std/NULL/NULL/registration.gen";
		get(url);
		
		dr.findElement(By.name("NewUserName")).sendKeys(username);
		dr.findElement(By.name("sn")).sendKeys("白");
		dr.findElement(By.name("cn")).sendKeys("花");
		dr.findElement(By.name("birth_year")).sendKeys("1990");
		dr.findElement(By.name("birth_month")).sendKeys("09");
		dr.findElement(By.name("birth_day")).sendKeys("24");
		dr.findElement(By.name("VerifyCode")).click();
		
		
		//////////////////////
		WebDriverWait wait = new WebDriverWait(dr,10000000);
		wait.until(new ExpectedCondition<WebElement>() {
			@Override
			public WebElement apply(WebDriver d) {
				return d.findElement(By.name("Income"));
			}
		}).sendKeys("1000-1500");
		
		
		dr.findElement(By.name("userPassword")).sendKeys(password );
		dr.findElement(By.name("ConfirmUserPassword")).sendKeys(password );
		
		dr.findElement(By.name("PasswordReminderQuestion")).sendKeys("dddddddddddddddd" );
		dr.findElement(By.name("PasswordReminderAnswer")).sendKeys("xxxxxxxxx" );
		
		
		dr.findElement(By.name("submit")).click();
		
		
		
		
		
		
	}

	public static void main(String[] args) {
		new ah163_com().reg("qq331798654", "qq3131798654");
	}
	
	
}
